<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>

<head>
    <title>ADMIRAL: Datasets</title>

    <!-- Import stylesheet -->
    <link rel="stylesheet" href="../css/SelectDataset.css" type="text/css" />

    <!-- Import jQuery framework -->
    <script type="text/javascript" src="../../jQuery/js/jquery-1.4.2.js"></script> 

    <!-- Import jQuery additional libraries -->
    <script type="text/javascript" src="../../jQuery/jquery.json-2.2.js"></script> 

    <!-- import rdfquery libraries -->
    <script type="text/javascript" src="../../rdfquery/jquery.uri.js"></script>
    <script type="text/javascript" src="../../rdfquery/jquery.xmlns.js"></script>
    <script type="text/javascript" src="../../rdfquery/jquery.curie.js"></script>
    <script type="text/javascript" src="../../rdfquery/jquery.datatype.js"></script>
    <script type="text/javascript" src="../../rdfquery/jquery.rdf.js"></script>
    <script type="text/javascript" src="../../rdfquery/jquery.rdfa.js"></script>
    <script type="text/javascript" src="../../rdfquery/jquery.datatype.js"></script>
    <script type="text/javascript" src="../../rdfquery/jquery.rdf.json.js"></script>
    <script type="text/javascript" src="../../rdfquery/jquery.rdf.xml.js"></script>
    <script type="text/javascript" src="../../rdfquery/jquery.rdf.turtle.js"></script>
 
    <!-- Import MochiKit modules: require MochiKit library functions to be fully qualified -->
    <script type="text/javascript">MochiKit = {__export__: false};</script>
    <script type="text/javascript" src="../../MochiKit/Base.js"></script>
    <script type="text/javascript" src="../../MochiKit/Iter.js"></script>
    <script type="text/javascript" src="../../MochiKit/Logging.js"></script>

    <!-- Import generic code from the dataset utils package -->
    <script type="text/javascript" src="../../DatasetUtils/js/DatasetManifestDictionary.js"></script>

    <!-- Import Admiral functions -->
    <script type="text/javascript" src="../../Admiral/admiral-base.js"></script>
    <script type="text/javascript" src="../../Admiral/Error.js"></script>
    <script type="text/javascript" src="../../Admiral/AsyncComputation.js"></script>
    <script type="text/javascript" src="../../SelectDataset/ListDatasets.js"></script>
    <script type="text/javascript" src="../../SelectDataset/GetDatasetsList.js"></script>

    <!--  Import admiral configuration details -->
    <!--  NOTE: these are loaded from an absolute location in the web server -->
    <script type="text/javascript" src="/js/admiral-config.js"></script>
    
    <script>
    // Use jQuery via jQuery(...)
    jQuery.noConflict();
    </script>

    <!-- Execute the desired dataset listing logic -->
    <script>
          	jQuery(document).ready( function ()
          	{   var m = new admiral.AsyncComputation();
          	    m.eval(function(val,callback)
          	    {
                    // Display research group name from local config file
                    jQuery("#groupname").text(admiral.researchgroup);
                    // Request listing of datasets from Databank via ADMIRAL server
          	        admiral.listDatasets("", admiral.databanksilo, admiral.getDatasetList, callback);            
          	    });
          	    m.eval(function(val,callback)
          	    {
          	        // val supplies a <div> element containing a <table> to be displayed
          	        jQuery("#tableDatasets").html("");          	        
          	        log.debug(val);
          	        jQuery("#tableDatasets").append(val.find("table"));
          	    });    
          	    m.exec(null,admiral.noop);
          	});
    </script>

</head>

<body>
    <!--<div>
        <span><a href="/"><img alt="site_logo" src="/images/Admiral-logo-284x100.png" border="0"/></a></span>
    </div>-->
  
   <h2>ADMIRAL Datasets in Oxford DataBank 
   <span><a href="/databanksilo"><img name="databank_logo" id="databank_logo" alt="databank_logo" src="http://databank.ora.ox.ac.uk/static/databank_logo_generic.png" /></a></span>
   </h2>
   <h3>Research Group: <span id="groupname">%{RESEARCHGROUPNAME}</span></h3>
   <form id="submitForm" name="submitForm" action="/" method="post">
     <div class="section sectionSpace">
  	    <table id="tableDatasets" style="padding:2px">
           <!-- 
  		     <thead>
  		         <tr>
  		           <th> Dataset identifier </th>
  		           <th> Version            </th>
  		           <th> Submitted on       </th>
  		           <th> Submitted by       </th>
  		        </tr>
  		    </thead>
            -->
  		    <tbody>
              <tr>
                  <td colspan="4">(Waiting for listing from Databank...)</td>
              </tr>
              <!-- 
              <tr>
                 <td><a href="somehost/somesilo/dataset/somedatasets1">somedataset1</a></td>
                 <td></td>
                 <td></td>
                 <td></td>
              </tr>
                -->
  		     </tbody>
  	      </table> 
          <!--<input name="cancel" id="cancel" type="submit" value="Home"/>-->
     </div>   
     <div class="section sectionSpace">
      <a href="/">Return to ADMIRAL front page</a>
     </div>
   </form>
</body>

</html>
